@ECHO OFF

REM Prevent changes to environment variables to be applied globally.
SETLOCAL

ECHO.
ECHO *****************
ECHO * Java location *
ECHO *****************
ECHO.

SET DEFAULT_JAVA_HOME=%JAVA_HOME%
IF "%DEFAULT_JAVA_HOME%" == "" SET DEFAULT_JAVA_HOME=C:\Program Files\java\jdk1.6.0_14
SET /P JAVA_HOME="Please enter the full installation path of Java SDK 1.6 (default: %DEFAULT_JAVA_HOME%): "
IF "%JAVA_HOME%" == "" SET JAVA_HOME=%DEFAULT_JAVA_HOME%
ECHO JAVA_HOME is "%JAVA_HOME%"
IF "%JAVA_HOME%" == "" GOTO UnableToContinue

ECHO.
ECHO ****************
ECHO * Ant location *
ECHO ****************
ECHO.

SET DEFAULT_ANT_HOME=%ANT_HOME%
IF "%DEFAULT_ANT_HOME%" == "" SET DEFAULT_ANT_HOME=C:\Program Files\apache-ant-1.7.1
SET /P ANT_HOME="Please enter the full installation path of Ant (default: %DEFAULT_ANT_HOME%): "
IF "%ANT_HOME%" == "" SET ANT_HOME=%DEFAULT_ANT_HOME%
ECHO ANT_HOME is "%ANT_HOME%"
IF "%ANT_HOME%" == "" GOTO UnableToContinue

SET PATH=%PATH%;%ANT_HOME%\bin


ECHO.
ECHO *********
ECHO * Build *
ECHO *********
ECHO.

CALL ant -verbose %1

GOTO Success


REM Failure.
:UnableToContinue
ECHO Unable to launch Ant build!


:Success
ENDLOCAL
PAUSE
